from django.db import models

# Create your models here.
from django.contrib.auth.models import AbstractUser

class User(AbstractUser):

    telephone = models.CharField(verbose_name= '手机号码',
                                 max_length= 11)
    avatar = models.FileField(verbose_name= '头像',
                              upload_to= 'avatar/',
                              default='avatar/default.png')
    is_active = models.BooleanField(verbose_name= '是否激活',
                                    default= False)
    create_time = models.DateField(verbose_name= '创建时间',
                                   auto_now_add= True)

    class Meta:
        verbose_name = '用户表'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.username